package me.CSmethod.demo;

import java.util.Scanner;

public class Text8 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        String str = "";
        while (a != 0) {
            int b = a % 10;
            a = a / 10;
            str = str + (b + 5) % 10;
        }
        System.out.println(str);
    }
}

